const app = getApp();
Component({
  /**
   * 组件的属性列表
   */
  properties: {
    lists:{
      type:Array
    }
  },

  /**
   * 组件的初始数据
   */
  data: {
    musicId:-1
  },
  pageLifetimes:{
    show() {
      let musicId = app.getPlayingMusicId()
      if (musicId) {
        this.setData({
          musicId
        })
      }
    }
  },

  /**
   * 组件的方法列表
   */
  methods: {
    onSelect(e) {
      const ds = e.currentTarget.dataset
      const musicId = e.currentTarget.dataset.musicid
      this.setData({
        musicId
      })
      wx.navigateTo({
        url: `../../pages/player/player?musicId=${musicId}&index=${ds.index}`,
      })
    }
  }
})
